package com.example.mobilenet

object InterpreterJni {

    const val kOnnxRuntime: Int = 1
    const val kMnn = 2

    fun getEngineString(engineType: Int): String {
        return when(engineType) {
            kOnnxRuntime -> {
                "Onnx"
            }
            kMnn -> {
                "Mnn"
            }
            else -> {
                "unKnow"
            }
        }
    }

    //创建Native底层TNet推理引擎
    external fun crateInterpreter(framework : Int, libPath:String, modelPath: String): Long

    //启动Native底层TNet引擎模型推理
    external fun run(inst: Long, imageData: IntArray, resultArray: FloatArray): String

    //获取模型输入InputTensor shape数组
    external fun getInputDataShape(inst: Long): IntArray

    //获取模型输出OutputTensor shape数组
    external fun getOutputDataShape(inst: Long): IntArray

    //销毁Native底层TNet推理引擎
    external fun destroyInterpreter(inst: Long)

}